Re-seed bundled core packages when content changes at the same version#113
Merged
Conversation
seedBundledPackage only re-extracted a bundled core package (BEAST.base, BEAST.app) into the user package dir when the bundled version was strictly newer than the copy already there. The package version string stays constant across a release cycle (e.g. 2.8.0), so after `mvn package` plus a fresh application build the stale lib/ was kept and the running app loaded pre-fix classes -- which is why the BEAUti Template menu fix (#110) worked in a developer environment but not in the installed app. When the user copy reports the same version as the bundled one, fall back to comparing a SHA-256 of the bundled zip against a marker recorded at seed time, and re-extract on mismatch. Versions that differ are still decided by number alone: a strictly newer user copy is never downgraded, a strictly older one is always replaced. The checksum is computed only when the versions match or when re-seeding. Fixes #112
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The BEAUti Template menu fix (#110, merged in #111) worked in a developer environment but the menu was still empty in the installed app (#112). The fix code was correct; it never reached the running app.
The release ships
BEAST.base/BEAST.appas package zips thatBeastLauncher.seedBundledPackage()extracts into the user package dir and loads as plugin module layers. That method only re-extracted when the bundled version was strictly newer than the copy already seeded. The package version string (version.xml) is constant across a release cycle (2.8.0), so aftermvn package+ a fresh build the stalelib/was kept and the app kept loading pre-fix classes. (Confirmed: the crash trace in #112 matches pre-fix line numbers.)Fix
When the user copy reports the same version as the bundled one, compare a SHA-256 of the bundled zip against a marker (
.bundled.checksum) written at seed time, and re-extract on mismatch. This catches development rebuilds and re-released betas, not just SNAPSHOTs.Differing versions are still decided by number alone — a strictly newer user copy (e.g. a package-manager upgrade) is never downgraded, a strictly older one is always replaced. The checksum is computed only when versions match or when re-seeding.
Tests
SeedBundledPackageReseedTest(new): same-version-new-content re-seeds, identical zip is left untouched, strictly-newer user copy is preserved. ExistingSeedBundledPackageTeststill passes.Fixes #112